<!--
 * @页面名称:
 * @描述:
 * @作者: 辛慰
 * @Date: 2019-06-03 17:37:46
 -->
<template>
  <div class="con-item">
    <div class="time-line">
      <div class="time-query">
        <el-select @change="selectTIime" v-model="form.region" placeholder="请选择库房">
          <el-option
            v-for="item in dateList"
            :key="item.id"
            :label="item.date"
            :value="item.id"
          ></el-option>
        </el-select>
      </div>
      <vuescroll :ops="ops">
        <div class="timeline-box">
          <div class="timeline-item" v-for="(item, index) in archivesInfo" :key="index">
            <ul>
              <li>
                <img class="camera-img" ref="scaleImg" v-if="item.state == 1" src="../assets/image/1.png" alt="" >
              </li>
              <li>
                <img class="camera-img" ref="scaleImg" v-if="item.state == 0" src="../assets/image/2.png" alt="" >
              </li>
            </ul>
            <div class="line" :style="{visibility:index == (archivesInfo.length - 1) ? 'hidden': 'visible'}"></div>
            <p class="date-text" v-if="item.state == 0">{{ item.loanTime }}</p>
            <p class="date-text" v-if="item.state == 1">{{ item.archiveTime }}</p>
            <p class="operator" v-if="item.state == 0">{{ item.fileNumber }} (借出)</p>
            <p class="operator" v-if="item.state == 1">{{ item.fileNumber }} (归档)</p>
          </div>
        </div>
      </vuescroll>
    </div>
    <el-table :data="archivesInfo" border style="width: 100%;margin-bottom:55px;margin-top:80px;">
      <el-table-column  prop="fileNumber"  label="档案号" align="center"></el-table-column>
      <el-table-column  prop="archivesTitle" label="题名" align="center"></el-table-column>
      <el-table-column  prop="loanTime"  label="借出时间" align="center"></el-table-column>
      <el-table-column  prop="archiveTime"  label="归档时间" align="center"></el-table-column>
      <el-table-column  prop="operator"  label="操作人" align="center"></el-table-column>
    </el-table>
    <div class="pagin">
      <span class="total">共{{totalCount}}条数据</span>
      <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page.sync="currentPage"
      layout="sizes, prev, pager, next"
      :page-sizes="[2, 5, 10, 20]"
      :total="totalCount">
      </el-pagination>
    </div>
  </div>
</template>

<script>
import vuescroll from 'vuescroll'
import imageSnapTimeline from '@/components/imageSnapTimeline'
export default {
  data () {
    return {
      conditionInfo: [
        {
          conditionName: '120103011111',
          conditionTemp: '《孔府档案选》',
          recondingTime: '2019-05-21 10:08:56',
          operator: '2019-05-29 12:08:56'
        }, {
          conditionName: '120103011112',
          conditionTemp: '孔府档案选编',
          recondingTime: '2019-05-21 10:08:56',
          operator: '2019-06-21 10:00:56'
        }, {
          conditionName: '120103011113',
          conditionTemp: '孔府档案的法律史料价值研究',
          recondingTime: '2019-05-21 10:08:56',
          operator: '2019-05-23 19:08:56'
        }, {
          conditionName: '120103011114',
          conditionTemp: '孔府档案概述',
          recondingTime: '2019-05-21 10:08:56',
          operator: '2019-05-25 13:08:23'
        }
      ],
      currImage: '',
      dialogTableVisible: false, // 模态框显示状态
      currentPage: 1, // 当前页
      pagesize: 10, // 一页的数量
      totalCount: 10, // 总条数
      form: {
        region: '近一天'
      },
      dateList: [
        {
          id: 0,
          date: '近一天'
        },
        {
          id: 1,
          date: '近七天'
        }
      ],
      archivesInfo: [
        {
          fileNumber: '#15121', // 档案号
          archivesTitle: '《孔府档案选》', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态 0--借出  1---归档
          operator: '张晓刚'
        },
        {
          fileNumber: '#15121', // 档案号
          archivesTitle: '孔府档案选编', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '程大开'
        },
        {
          fileNumber: '#12301', // 档案号
          archivesTitle: '孔府档案的法律史料价值研究', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '刘哲思'
        },
        {
          fileNumber: '#12351', // 档案号
          archivesTitle: '孔府档案的由来', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态
          operator: '朱小军'
        },
        {
          fileNumber: '#45121', // 档案号
          archivesTitle: '孔府档案的法律史料价值研究', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '王宇恒'
        },
        {
          fileNumber: '#24121', // 档案号
          archivesTitle: '孔府档案概述', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态
          operator: '马谡年'
        },
        {
          fileNumber: '#15121', // 档案号
          archivesTitle: '《孔府档案选》', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态 0--借出  1---归档
          operator: '张晓刚'
        },
        {
          fileNumber: '#15121', // 档案号
          archivesTitle: '孔府档案选编', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '程大开'
        },
        {
          fileNumber: '#12301', // 档案号
          archivesTitle: '孔府档案的法律史料价值研究', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '刘哲思'
        },
        {
          fileNumber: '#12351', // 档案号
          archivesTitle: '孔府档案的由来', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态
          operator: '朱小军'
        },
        {
          fileNumber: '#45121', // 档案号
          archivesTitle: '孔府档案的法律史料价值研究', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 1, // 状态
          operator: '王宇恒'
        },
        {
          fileNumber: '#24121', // 档案号
          archivesTitle: '孔府档案概述', // 档案题名
          loanTime: '2019-02-14 18:25:08', // 借出时间
          archiveTime: '2019-02-17 18:25:08', // 归档时间
          state: 0, // 状态
          operator: '马谡年'
        }
      ],
      ops: { // 滚动条参数配置
        bar: {
          showDelay: 500,
          onlyShowBarOnScroll: true,
          keepShow: true,
          background: '#DEDEDE',
          opacity: 1,
          hoverStyle: false,
          specifyBorderRadius: false,
          minSize: false,
          size: '6px',
          disable: false
        },
        scrollPanel: {
          scrollingX: true,
          scrollingY: false
        }
      }
    }
  },
  components: {
    vuescroll,
    imageSnapTimeline
  },
  mounted () {
    this.totalCount = this.archivesInfo.length
  },
  methods: {
    selectTIime () {
      console.log('')
    },
    checkSubmember (val, index) {
      console.log(val, index)
      this.currImage = val.snapIamge
      this.dialogTableVisible = true
    },
    checkDisappear () {
      this.dialogTableVisible = false
    },
    handleSizeChange (val) {
      this.pagesize = val
    },
    handleCurrentChange (val) {
      this.currentPage = val
    }
  }
}
</script>

<style scoped>
.time-line {
  width: 100%;
  height: 2.2rem;
}
.time-query {
  display: flex;
  justify-content: flex-start;
}
.query {
  margin-right: .2rem;
}
.vuescroll-box {
  overflow-x: hidden;
  border: 1px solid #333;
  box-sizing: border-box;
}
.timeline-box {
  margin-top: .2rem;
  height: 1.8rem;
  padding-left: .6rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  border: 1px solid #eee;
  box-sizing: border-box;
  cursor: pointer;
}
.timeline-item {
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  position: relative;
}
.camera-img {
  width: .24rem;
  height: .24rem;
  display: inline-block;
  border-radius: 50%;
}
.line {
  width: 1.4rem;
  display: inline-block;
  border-top: 2px solid #333;
}
.date-text {
  font-size: .12rem;
  position: absolute;
  top: 65%;
  left: -.4rem;
}
.operator {
  font-size: .14rem;
  position: absolute;
  top: 24%;
  left: 0px;
}

.snap-small-img {
  width: .6rem;
  height: .6rem;
  display: block;
  position: absolute;
  top: 6%;
  left: -.2rem;
}
.snapImage {
  width: .4rem;
  height: .3rem;
  display: block;
}
.modal{
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 1000;
}
.modalImg{
  width: 6.8rem;
  height: 4.2rem;
  z-index: 1001;
  position: relative;
  top: 1.34rem;
}
.modalIcon{
  width: .5rem;
  height: .5rem;
  position: relative;
  top: 2.2rem;
  left: -3.63rem;
  cursor: pointer;
}
.el-table thead {
  background: #f3f4f8;
}
.pagin {
  display: flex;
  justify-content: space-between;
}

ul li img{
  transition:1s;
  -webkit-transition:1s;
  -moz-transition:1s;
}
ul li img:hover{
  -webkit-transform:rotate(360deg) scale(1.5);
  -moz-transform:rotate(360deg) scale(1.5);
  -ms-transform:rotate(360deg) scale(1.5);
  -o-transform:rotate(360deg) scale(1.5);
}
</style>
